<template>
  <BasicModal v-bind="$attrs" @register="registerModal" :footer="null" title="详情" width="40%" minHeight="120"
    destroyOnClose>
    <Description :column="1" :data="dataInfo" :schema="formSchema" />
  </BasicModal>
</template>
<script lang="ts" setup>
import { ref, useAttrs } from 'vue';
import { Description, useDescription } from '/@/components/Description/index';
import BasicModal from "/@/components/Modal/src/BasicModal.vue";
import { useModalInner } from "/@/components/Modal";
const emit = defineEmits(['register']);
const attrs = useAttrs();
const dataInfo = ref({});
const formSchema = [
  {
    label: '名称',
    field: 'name',
    labelMinWidth: 100
  },
  {
    label: '分类',
    field: 'category_dictText'
  },
  {
    label: '周期',
    field: 'planTime'
  },
  {
    label: '特点',
    field: 'memo',
  },
];
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  setModalProps({ confirmLoading: false });
  console.log(data);
  dataInfo.value = data.record;
  dataInfo.value.planTime = [data.record.startMonth, data.record.endMonth].join(' 至 ')
  console.log(dataInfo.value);
});
</script>
